import request from '@/utils/request'
// 获取文章内容API
export const getArticleAPI = ({ channel_id, timestamp = new Date() }) => request({
  url: '/v1_0/articles',
  params: {
    channel_id,
    timestamp
  }
})
// 获取不喜欢文章的API
export const dislike = (target) => request({
  url: '/v1_0/article/dislikes',
  method: 'POST',
  data: {
    target
  }
})

// 举报文章的API
export const reportsAPI = ({ target, type }) => request({
  url: '/v1_0/article/reports',
  method: 'POST',
  data: {
    target,
    type,
    remark: '魏清魏清啦啦啦'
  }
})
// 获取文章详情的API
export const getDetailAPI = (id) => request({
  url: '/v1_0/articles/' + id
})
// 对文章点赞的API
export const likingAPI = (id) => request({
  url: '/v1_0/article/likings',
  method: 'POST',
  data: {
    target: id
  }
})
// 获取文章评论的API
export const getCommentAPI = ({ art_id, offset = null, limit = 10 }) => request({
  url: '/v1_0/comments',
  params: {
    type: 'a',
    source: art_id,
    offset,
    limit
  }
})
